import torch as pt
import numpy as np


class ConvBnLeakyRelu(pt.nn.Module):

    def __init__(self, in_ch, out_ch, ksize=(3, 3), stride=(1, 1), padding=1, **kwargs):
        super().__init__(**kwargs)
        self.conv = pt.nn.Conv2d(in_ch, out_ch, ksize, stride, padding)
        self.bn = pt.nn.BatchNorm2d(out_ch)
        self.leaky = pt.nn.LeakyReLU()

    def forward(self, inputs):
        x = self.conv(inputs)
        x = self.bn(x)
        x = self.leaky(x)
        return x
